import Cookies from 'js-cookie'

const TokenKey = 'itheima-hrsaas-ihrm-token'

export const getToken = () => {
  return Cookies.get(TokenKey)
}

export const setToken = (token) => {
  return Cookies.set(TokenKey, token)
}

export const removeToken = () => {
  return Cookies.remove(TokenKey)
}

const TimeKey = 'itheima-hrsaas-timestamp-key' // 设置一个独一无二的key

// 获取时间戳
export const getTimeStamp = () => {
  return Cookies.get(TimeKey)
}

// 设置时间戳
export const setTimeStamp = () => {
  return Cookies.set(TimeKey, Date.now())
}
